This code will help produce the three visuals that are going to be a
part of each equity tracker indicator webpage: regional map (tract
level) of most recent data, chart of the most recent data, chart of
trends over time.
If the indicator is available through a tract-level data
set. Getting the data to a workable version may require some
data transformation. To explore, clean, transform, and generate a final
data set, please use the data-gen-tract-template. This script
will generate an .rda for the map and an .rda for the charts. These data
sets will be loaded in before the data visualization code.
Voter participation provides a way to understand a community’s
political engagement. Differences between groups of people can highlight
differing access to engagement opportunities. The ability to participate
in civic processes ensures fair representation and adequate access to
services and resources, all of which influence a population’s connection
to their community.
Voter participation is calculated by dividing the number of ballots cast
by the number of people over 18 within a census tract. This process uses
data from the Washington Secretary of State office (ballots cast per
precinct) and population data from the United States Census Bureau
American Community Survey (ACS) and Washington State Office of Financial
Management (OFM) Small Area Estimates Program (SAEP). The population
over 18 is calculated by weighting the OFM estimates by the ratio of
adults 18+/total population from ACS. There are a few data caveats: 1)
Some voters may be registered in one location, but reside in another.
This could cause mismatches in the way that they are accounted for in
the numerator (ballots cast) and the denominator (population); 2) There
is a distinction between residential addresses (which must be in
Washington State and where you are considered registered for voting
purposes) and mailing addresses (which can be anywhere). Therefore, the
number of registered voters refers to the number of voters who have
their residential address in that precinct; 3) Data from smaller
precincts are occasionally “masked” into a larger precinct in order to
protect the privacy of voters and maintain confidentiality. It is also
possible for last minuet ballots to be cast (such as by UOCAVA voters,
or Military and Overseas Voters, defined by https://www.eac.gov/uocava) that must be accorded to a
precinct. As a result, the voter turnout results calculated at the tract
level are estimates and may reflect some margin of error.
Sources: Washington Office of Secretary of State 2024 general election data; U.S. Census Bureau, American Community Survey (ACS) 2024 5-Year Estimates; U.S. Census Bureau, Geography Division 2020 TIGER/Line Shapefiles
Voter Participation
2024 election data
Washington Office of Secretary of State 2024 general election data; U.S. Census Bureau, 2020-2024 American Community Survey 5-Year Estimates, Tables B02001, C17002, B22010, B11005, B11007, C16002
Voter Participation
2024 election data
Washington Office of Secretary of State 2012, 2016, 2020, 2024 general election data; U.S. Census Bureau, 2008-2012, 2012-2016, 2016-2020, 2020-2024 American Community Survey 5-Year Estimates, Tables B02001, C17002, B22010, B11005, B11007, C16002
This step will transfer all of the Rmd output files (html and docx) to the network for review. It will keep the Rmd files within GitHub so that code is kept in a central place. Always run this chunk of code. If this is the first time you are generating visuals for an indicator, comment out the ‘update’ part of the ‘y.drive.folder.update’ variable because this is the first version that is being created.
This step will transfer the previous data and files to the archive folder. This step is meant to retain the older versions in case they are needed for reference. Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.
This step will clean the indicator folder to make room for the new versions. Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.
This step will move all of the updated data/files to the general indicator folder. They should be moved from the update (draft staging directory) to the parent folder so that the htmls can be copied to the webpage folder (outside the firewall). Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.
This step will help keep the folders organized and ready for the next update.Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.
This step copies the htmls for the webpage (3 visuals) from the network to the folder outside the firewall- this ‘external’ folder connects directly to the webpage. Always run this chunk of code.